from flask import Flask, render_template, request

app = Flask(__name__)


@app.route("/login")
def login():
    return render_template("login.html")


@app.route("/handle",methods=["POST"])
def handle():
    # form表单数据
    form_results = request.form
    # 显示
    username = form_results.get("name")
    chinese = form_results.get("chinese")
    programming = form_results.get("programming")
    description = form_results.get("description")
    # 数据
    results = {"username": username,
               "chinese": chinese,
               "programming": programming,
               "description": description}

    return render_template("results.html",results=results)


if __name__ == '__main__':
    app.run(debug=True)
